package com.mdd.front.validate.goods;

import com.mdd.common.validator.annotation.IDMust;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 服务参数
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class GoodsParam implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface create{}
    public interface update{}
    public interface delete{}

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class})
    private Long id;

    @NotNull(message = "name参数缺失", groups = {create.class, update.class})
    @Length(max = 64, message = "name参数不能超出64个字符", groups = {create.class, update.class})
    private String name;

    @Length(max = 255, message = "remarks参数不能超出255个字符", groups = {create.class, update.class})
    private String remarks;

    @NotNull(message = "categoryId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "categoryId参数值不能少于0", groups = {create.class, update.class})
    private Long categoryId;

    @NotNull(message = "unitId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "unitId参数值不能少于0", groups = {create.class, update.class})
    private Long unitId;

    @NotNull(message = "image参数缺失", groups = {create.class, update.class})
    private String image;

    @NotNull(message = "price参数缺失", groups = {create.class, update.class})
    @Length(max = 10, message = "price参数不能超出10个字符", groups = {create.class, update.class})
    private BigDecimal price;

    @Length(max = 10, message = "scribingPrice参数不能超出10个字符", groups = {create.class, update.class})
    private BigDecimal scribingPrice;

    @NotNull(message = "status参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "status参数值不能少于0", groups = {create.class, update.class})
    private Integer status;

    @NotNull(message = "sort参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "sort参数值不能少于0", groups = {create.class, update.class})
    private Integer sort;

    private String content;


    @ApiModelProperty(value = "预约人数")
    private Integer orderNum;

    @ApiModelProperty(value = "服务积分")
    private BigDecimal integral = new BigDecimal(0.0);

    @ApiModelProperty("是否手动派单 0 系统派单 1 手动派单")
    private Integer isManualDispatch;

    @ApiModelProperty("超出数量")
    private Integer outNumber;

    @ApiModelProperty("是否轮播：0-否、1-是")
    private Integer carousel;

    @ApiModelProperty("今日特价的优惠的价格")
    private BigDecimal afterPrice;

    @ApiModelProperty("限时专区服务数量")
    private Integer limitedGoodsNum;

    @ApiModelProperty("限时专区开始时间设置 格式： yyyy-MM-dd HH:mm:ss")
    private String limitedStartTime;

    @ApiModelProperty("限时专区结束时间设置 格式： yyyy-MM-dd HH:mm:ss")
    private String limitedEndTime;


    @ApiModelProperty("是否团购：0-否、1-是")
    private Integer isBuy;

    @ApiModelProperty("团购数量  - 扩展字段")
    private Integer buyNum;

    @ApiModelProperty("团购人数")
    private Integer buyPeopleNum;


}
